﻿using HamcoWcs.Models.TibcoMessage;
using System.Collections.Generic;
using System.Linq;

namespace HamcoWcs.Models.Charts
{
    public class ShelfChartDto
    {
        public ShelfChartDto()
        {

        }

        public ShelfChartDto(List<Zone> zonesData)
        {
            ZonesData = zonesData;

            if (zonesData != null && zonesData.Count > 0)
            {
                TotalCapacity = zonesData.Sum(x => x.TotalCapacity);
                UsedShelfCount = zonesData.Sum(x => x.UsedShelfCount);
                EmptyShelfCount = zonesData.Sum(x => x.EmptyShelfCount);
                BlockedEmptyShelfCount = zonesData.Sum(x => x.BlockedEmptyShelfCount);
                ReserveShelfCount = zonesData.Sum(x => x.ReserveShelfCount);
            }

        }
        public int TotalCapacity { get; set; }
        public int UsedShelfCount { get; set; }
        public int EmptyShelfCount { get; set; }
        public int BlockedEmptyShelfCount { get; set; }
        public int ReserveShelfCount { get; set; }
        public List<Zone> ZonesData { get; set; }
    }

}
